"""
整合模块处理的结果，统一格式返回
"""


def api_response(result_code=None, user_id=None, content=None, tokens=None):

    result_dict = result_code.value  # 获取枚举类属性的 value 数据
    print(result_dict)
    code = result_dict.get('code')
    message = str(result_dict.get('message'))
    response = {
            'code': code,
            'user_id': user_id,
            'content': content,
            'message': message
    }
    if tokens:
        response['token'] = tokens
    return response


def info_response(result=None, user_id=None, content=None, token=None):

    return "用户信息查询的返回"





